/*
 * Tomer Nuni 300585312
 * Idan Meshita 300043726
 */
import java.awt.Frame;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.io.IOException;


public class Ex2Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {

		
		Ex2Main ex2Main = new Ex2Main();
		ex2Main.start();
	}

	private void start() {
		Frame myFrame = new Frame("Exercise2");
		MyCanvas myCanvas = new MyCanvas();
		try {
			myCanvas.initCanvas();
			myFrame.add(myCanvas);
			myFrame.addKeyListener(myCanvas);

			WindowAdapter myWindowAdapter = new WindowAdapter(){
				public void windowClosing(WindowEvent e) {
					System.exit(0);
				}
			};

			myFrame.addWindowListener(myWindowAdapter);

			myFrame.pack();
			myFrame.setVisible(true);
		} catch (IOException e1) {
			// TODO Auto-generated catch block
			e1.printStackTrace();
		}

		
	}
	

}
